
<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
  defined('_JEXEC') or die('Retricted Access');
  global $jbconfig;
  global $option;
  $item = $this->item;
  $cid 	= JRequest::getVar( 'cid', array(), '', 'array' );
		JArrayHelper::toInteger( $cid );
    	if(is_array($cid)) $cid = $cid[0];
?>
<script type="text/javascript">
function CalendarChanged(id)
{
	form = document.adminForm;
	calendar = document.getElementById(id);
	today = new Date();
//	datefield = id;
	
//	field = document.getElementById(datefield);
	if (calendar.value != '')
	{
		 temp = calendar.value + ' ' + today.getHours() + ':' + today.getMinutes()+ ':' + today.getSeconds();
		 calendar.value = temp;
	}
}

function isFeatured(value)
{
	form = document.adminForm;
	
	form.featured.value = value
	
}
</script>
<form name="adminForm" action="index.php" method="post" enctype="multipart/form-data">
    <table width="100%">
		<tr>
			<td width="80%" valign="top">
				<div style="width:100%;">
					<?php echo $this->menu();?>
					<br>
					<fieldset>
					<legend><?php echo JText::_('Account Information');?></legend>
			    	
			    	<fieldset>
			    		
						<legend><?php echo JText::_('Balance');?></legend>
			        	<table class="admintable" width="100%">
						<tr>
							<td class="key" width="20%">
								<label for="credit_balance">
									<?php echo JText::_('Credits balance'); ?>:
								</label>
							</td>
							<td width="80%">
								<input type="text" name="credit_balance" value="<?php echo $item->credit_balance?$item->credit_balance:0; ?>" />
							</td>
						</tr>
						<tr>
							<td class="key" width="20%">
								<label for="standard_posts_balance">
									<?php echo JText::_('Standard posting left'); ?>:
								</label>
							</td>
							<td width="80%">
								<input type="text" name="standard_posts_balance" value="<?php echo $item->standard_posts_balance?$item->standard_posts_balance:0; ?>" />
							</td>
						</tr>
						<tr>
							<td class="key" width="20%">
								<label for="premium_posts_balance">
									<?php echo JText::_('Premium posting left'); ?>:
								</label>
							</td>
							<td width="80%">
								<input type="text" name="premium_posts_balance" value="<?php echo $item->premium_posts_balance?$item->premium_posts_balance:0; ?>" />
							</td>
						</tr>
						</table>
					</fieldset> 
					<fieldset>
						<legend><?php echo JText::_('Search resume');?></legend>
						<table class="admintable" width="100%">
				        <tr>
							<td class="key" width="20%">
								<label for="begin_date_search_resume">
									<?php echo JText::_('Start date');?>:
								</label>
							</td>
							<td width="80%">
				    			<?php  
				    				$dateFormat = $jbconfig['general']->get('format_date');
									if($dateFormat){
										$dateFormat = explode(" ", $dateFormat);
										$dateFormat = $dateFormat[0];				
									}else $dateFormat = "%Y-%m-%d h:i:s";
									$dateFormat = "%Y-%m-%d";
									if( strpos( $item->begin_date_search_resume, "1970-01-01") !== false || strpos( $item->begin_date_search_resume, "0000-00-00") !== false  )
				    				    $item->begin_date_search_resume = "";
									
									if($item->begin_date_search_resume)
										$item->begin_date_search_resume = date(str_replace("%", "", $dateFormat)." H:i:s", strtotime($item->begin_date_search_resume) );
																						    				
				    				echo JHTML::_('calendar', $item->begin_date_search_resume,'begin_date_search_resume','begin_date_search_resume', $dateFormat ,'class="inputbox" size="30"  maxlength="19" onchange="CalendarChanged(this.name)"');
				    			?>							
<!--								<input type="text" name="begin_date_search_resume" value="<?php echo $item->begin_date_search_resume; ?>" />-->
							</td>
						</tr>
						<tr>
							<td class="key" width="20%">
								<label for="end_date_search_resume">
									<?php echo JText::_('End date');?>:
								</label>
							</td>
							<td width="80%">
				    			<?php
				    			
				    				if( strpos( $item->end_date_search_resume, "1970-01-01") !== false || strpos( $item->end_date_search_resume, "0000-00-00") !== false  )
				    				    $item->end_date_search_resume = "";
				    				
				    				if($item->end_date_search_resume)
				    					$item->end_date_search_resume = date(str_replace("%", "", $dateFormat)." H:i:s", strtotime($item->end_date_search_resume) );
				    							    								    				
				    				echo JHTML::_('calendar',$item->end_date_search_resume,'end_date_search_resume','end_date_search_resume', $dateFormat,'class="inputbox" size="30"  maxlength="19" onchange="CalendarChanged(this.name)"');
				    			?>								
<!--								<input type="text" name="end_date_search_resume" value="<?php echo $item->end_date_search_resume; ?>" />-->
							</td>
						</tr>
						</table>
					</fieldset>
						<table class="admintable" width="100%">
							<tr>
								<td width="20%" class="key">
									<?php echo JText::_('Is featured'); ?>
								</td>
									
								<td width="80%">
									<?php if ($item->featured==0) {?>
									<input type="radio" value="0" name="is_featured" checked onclick="isFeatured(this.value)"/><?php echo JText::_('No'); ?>
									<input type="radio" value="1" name="is_featured"  onclick="isFeatured(this.value)"/><?php echo JText::_('Yes'); ?>
									<?php } else { ?>
									<input type="radio" value="0" name="is_featured" onclick="isFeatured(this.value)"/><?php echo JText::_('No'); ?>
									<input type="radio" value="1" name="is_featured" checked onclick="isFeatured(this.value)"/><?php echo JText::_('Yes'); ?>
									<?php } ?>
								</td>
							</tr>
						</table>					
					</fieldset>    
				</div>
			</td>
		</tr>
	</table>
	
	<input type="hidden" name="featured" value="<?php echo $item->featured; ?>" />
	<input type="hidden" name="cid" value="<?php echo $cid; ?>" />
	<input type="hidden" name="id" value="<?php echo $item->id; ?>" />
	<input type="hidden" name="user_id" value="<?php echo $cid; ?>" />
	<input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="view" value="jaemployers" />
	<input type="hidden" name="task" value="" />
 </form>